Integrand size = 19, antiderivative size = 31 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a+b) \log (\cosh (c+d x))}{d}-\frac {b \tanh ^2(c+d x)}{2 d} \]
[Out]
Time = 0.03 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3712, 3556} \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a+b) \log (\cosh (c+d x))}{d}-\frac {b \tanh ^2(c+d x)}{2 d} \]
[In]
[Out]
Rule 3556
Rule 3712
Rubi steps \begin{align*} \text {integral}& = -\frac {b \tanh ^2(c+d x)}{2 d}-(-a-b) \int \tanh (c+d x) \, dx \\ & = \frac {(a+b) \log (\cosh (c+d x))}{d}-\frac {b \tanh ^2(c+d x)}{2 d} \\ \end{align*}
Time = 0.04 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.32 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {a \log (\cosh (c+d x))}{d}+\frac {b \log (\cosh (c+d x))}{d}-\frac {b \tanh ^2(c+d x)}{2 d} \]
[In]
[Out]
Time = 0.08 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.58
method | result | size |
derivativedivides | \(\frac {-\frac {b \tanh \left (d x +c \right )^{2}}{2}-\frac {\left (a +b \right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (-a -b \right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(49\) |
default | \(\frac {-\frac {b \tanh \left (d x +c \right )^{2}}{2}-\frac {\left (a +b \right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (-a -b \right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(49\) |
parts | \(\frac {a \ln \left (\cosh \left (d x +c \right )\right )}{d}+\frac {b \left (-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}\) | \(52\) |
parallelrisch | \(-\frac {2 a d x +2 d x b +b \tanh \left (d x +c \right )^{2}+2 \ln \left (1-\tanh \left (d x +c \right )\right ) a +2 \ln \left (1-\tanh \left (d x +c \right )\right ) b}{2 d}\) | \(55\) |
risch | \(-a x -b x -\frac {2 a c}{d}-\frac {2 b c}{d}+\frac {2 b \,{\mathrm e}^{2 d x +2 c}}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) a}{d}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) b}{d}\) | \(86\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 399 vs. \(2 (29) = 58\).
Time = 0.27 (sec) , antiderivative size = 399, normalized size of antiderivative = 12.87 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {{\left (a + b\right )} d x \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} d x \sinh \left (d x + c\right )^{4} + {\left (a + b\right )} d x + 2 \, {\left ({\left (a + b\right )} d x - b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} d x \cosh \left (d x + c\right )^{2} + {\left (a + b\right )} d x - b\right )} \sinh \left (d x + c\right )^{2} - {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} + a + b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} + {\left (a + b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a + b\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) + 4 \, {\left ({\left (a + b\right )} d x \cosh \left (d x + c\right )^{3} + {\left ({\left (a + b\right )} d x - b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{d \cosh \left (d x + c\right )^{4} + 4 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + d \sinh \left (d x + c\right )^{4} + 2 \, d \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (d \cosh \left (d x + c\right )^{3} + d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 60 vs. \(2 (26) = 52\).
Time = 0.09 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.94 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\begin {cases} a x - \frac {a \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + b x - \frac {b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {b \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right ) \tanh {\left (c \right )} & \text {otherwise} \end {cases} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (29) = 58\).
Time = 0.28 (sec) , antiderivative size = 76, normalized size of antiderivative = 2.45 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=b {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + \frac {a \log \left (\cosh \left (d x + c\right )\right )}{d} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.84 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {{\left (d x + c\right )} {\left (a + b\right )} - {\left (a + b\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) - \frac {2 \, b e^{\left (2 \, d x + 2 \, c\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{2}}}{d} \]
[In]
[Out]
Time = 1.80 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.19 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=x\,\left (a+b\right )-\frac {b\,{\mathrm {tanh}\left (c+d\,x\right )}^2}{2\,d}-\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )\,\left (a+b\right )}{d} \]
[In]
[Out]